<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
	<title>湖南省自来水公司营销管理信息系统</title> 
	
	<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title" />	
	<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title" />	
	
	<link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title" />
	
	<link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">
    <script  language="JavaScript" type="text/javascript">
        var idTmr;
        function  getExplorer() {
            var explorer = window.navigator.userAgent ;
            //ie
            if (explorer.indexOf("MSIE") >= 0) {
                return 'ie';
            }
            //firefox
            else if (explorer.indexOf("Firefox") >= 0) {
                return 'Firefox';
            }
            //Chrome
            else if(explorer.indexOf("Chrome") >= 0){
                return 'Chrome';
            }
            //Opera
            else if(explorer.indexOf("Opera") >= 0){
                return 'Opera';
            }
            //Safari
            else if(explorer.indexOf("Safari") >= 0){
                return 'Safari';
            }
        }
        function method1(tableid) {//整个表格拷贝到EXCEL中
            if(getExplorer()=='ie') {
                var curTbl = document.getElementById(tableid);
                var oXL = new ActiveXObject("Excel.Application");

                //创建AX对象excel
                var oWB = oXL.Workbooks.Add();
                //获取workbook对象
                var xlsheet = oWB.Worksheets(1);
                //激活当前sheet
                var sel = document.body.createTextRange();
                sel.moveToElementText(curTbl);
                //把表格中的内容移到TextRange中
                sel.select;
                //全选TextRange中内容
                sel.execCommand("Copy");
                //复制TextRange中内容
                xlsheet.Paste();
                //粘贴到活动的EXCEL中
                oXL.Visible = true;
                //设置excel可见属性

                try {
                    var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");
                } catch (e) {
                    print("Nested catch caught " + e);
                } finally {
                    oWB.SaveAs(fname);

                    oWB.Close(savechanges = false);
                    //xls.visible = false;
                    oXL.Quit();
                    oXL = null;
                    //结束excel进程，退出完成
                    //window.setInterval("Cleanup();",1);
                    idTmr = window.setInterval("Cleanup();", 1);
                }
            } else {
                tableToExcel('ta')
            }
        }
        function Cleanup() {
            window.clearInterval(idTmr);
            CollectGarbage();
        }

        /*
            template ： 定义文档的类型，相当于html页面中顶部的<!DOCTYPE> 声明。（个人理解，不确定）
            encodeURIComponent:解码
            unescape() 函数：对通过 escape() 编码的字符串进行解码。
            window.btoa(window.encodeURIComponent(str)):支持汉字进行解码。
            \w ：匹配包括下划线的任何单词字符。等价于’[A-Za-z0-9_]’
            replace()方法：用于在字符串中用一些字符替换另一些字符，或替换一个与正则表达式匹配的子串。
            {(\w+)}：匹配所有 {1个或更多字符} 形式的字符串；此处匹配输出内容是 “worksheet”
            正则中的() ：是为了提取匹配的字符串。表达式中有几个()就有几个相应的匹配字符串。
            讲解(/{(\w+)}/g, function(m, p) { return c[p]; } ：
                /{(\w+)}/g 匹配出所有形式为“{worksheet}”的字符串；
                function参数：  m  正则所匹配到的内容，即“worksheet”；
                                p  正则表达式中分组的内容,即“(\w+)”分组中匹配到的内容，为“worksheet”；
                c ：为object，见下图3
                c[p] : 为“worksheet”

        */
        var tableToExcel = (function() {
            var uri = 'data:application/vnd.ms-excel;base64,',
            template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
            base64 = function(s) {
                return window.btoa(unescape(encodeURIComponent(s)))
            },
            // 下面这段函数作用是：将template中的变量替换为页面内容ctx获取到的值
            format = function(s, c) {
                    return s.replace(/{(\w+)}/g,
                                    function(m, p) {
                                        return c[p];
                                    }
                    )
            };
            return function(table, name) {
                if (!table.nodeType) {
                    table = document.getElementById(table)
                }
                // 获取表单的名字和表单查询的内容
                var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML};
                // format()函数：通过格式操作使任意类型的数据转换成一个字符串
                // base64()：进行编码
                window.location.href = uri + base64(format(template, ctx))
            }
        })()
    </script>
</head> 
 
<body> 

<div id="wrapper">
	
	<div id="header">
		
		<div class="content_pad">
			<h1><a href="../workspace.html">湖南省自来水公司营销管理信息系统</a></h1>
			
			<ul id="nav">
				
				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-wrench"></span>业扩工程</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="../page/be__request.html">01 用户申请</a></li>
							<li><a href="../page/be__audit.html">02 初步审核</a></li>
							<li><a href="../page/be__pay.html">03 交施工费</a></li>
							<li><a href="../page/be__billclear.html">04 水费清算</a></li>
							<li><a href="../page/be__contract.html">05 供水协议</a></li>
							<li><a href="../page/be__working.html">06 施工竣工</a></li>
							<li><a href="../page/be__open.html">07 通水停水</a></li>
							<li><a href="../page/be__save.html">08 档案存档</a></li>
							<li><a href="../page/be_order.html">工单管理</a></li>
							<li><a href="../page/be_abort.html">终止工单</a></li>
							<li><a href="../page/be_reportProgress.html">业扩工程进度</a></li>
							<li><a href="../page/be_reportMoney.html">业扩收费报表</a></li>
						</ul>
						
					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-person"></span>用户管理</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="../page/user_search.html">用户查询</a></li>	
							<li><a href="../page/user_add.html">快捷新户</a></li>	
							<li><a href="../page/user_changeName.html">快捷过户</a></li>
							<li><a href="../page/user_changeBank.html">快捷代扣</a></li>
							<li><a href="../page/user_changeMeter.html">快捷换表</a></li>
							<li><a href="../page/user_changeFormula.html">快捷重签</a></li>
							<li><a href="../page/user_delete.html">快捷销户</a></li>
							<li><a href="../page/user_reportShortcut.html">快捷操作记录</a></li>
							<li><a href="../page/user_docNum.html">档案号管理</a></li>
							<li><a href="../page/user_sendMsg.html">短信群发</a></li>
						</ul>
						
					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-pencil"></span>抄表管理</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="../page/rd_volume.html">表册管理</a></li>	
							<li><a href="../page/rd_init.html">抄表初始化</a></li>	
							<li><a href="../page/rd_task.html">任务分配</a></li>	
							<li><a href="../page/rd_enter.html">抄表录入</a></li>	
							<li><a href="../page/rd_audit.html">抄表审核</a></li>
							<li><a href="../page/rd_reportReading.html">抄表情况查询</a></li>	
							<li><a href="../page/rd_reportVolumeReading.html">抄表统计报表</a></li>	
							<li><a href="../page/rd_reportZero.html">零吨位用户查询</a></li>	
							<li><a href="../page/rd_reportMaxValue.html">最大码值修正记录</a></li>
							<li><a href="../page/rd_reportCPreAmount.html">底码修正记录</a></li>	
							<li><a href="../page/rd_reportMeterCheck.html">水表周检报表</a></li>
						</ul>
						
					</div>
				</li>
				
				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-star"></span>收费管理</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="../page/pay_window.html">窗口收费</a></li>	
							<li><a href="../page/pay_batch.html">批量收费</a></li>
							<li><a href="../page/pay_invoiceReprint.html">发票补开/作废</a></li>	
							<li><a href="../page/pay_reportDebts.html">欠费报表</a></li>	
							<li><a href="../page/pay_reportPay.html">收费情况报表</a></li>	
							<li><a href="../page/pay_reportMonthRecycle.html">月资金回收情况报表</a></li>	
							<li><a href="../page/pay_reportBalance.html">用户预收情况报表</a></li>	
							<li><a href="../page/pay_reportWaterType.html">各类用水统计总表</a></li>
						</ul>
						
					</div>
				</li>
				
				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-script"></span>发票管理</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="/queryIvInvoice">发票总表</a></li>
                            <li><a href="/addview">发票入库</a></li>
                            <li><a href="/addout">发票出库</a></li>
                            <li><a href="/addArchive">发票交票</a></li>
                            <li><a href="/queryOut">发票出库情况查询</a></li>
							<li><a href="inv_invoiceReportEmp.html">收费人员发票查询</a></li>	
							<li><a href="inv_invoiceReportArchive.html">发票交票情况查询</a></li>	
							<li><a href="inv_invoiceReportUse.html">发票使用情况查询</a></li>	
							<li><a href="inv_invoiceReportMoneySum.html">销账汇总报表</a></li>	
							<li><a href="inv_invoiceReportMoneyDetail.html">销账明细报表</a></li>	
						</ul>
					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-gear"></span>系统设置</a>
					
					<div class="nav_menu">			
						<ul>
							<li><a href="/querySyArea">抄表辖区</a></li>	
							<li><a href="/querySyMetertype">水表型号</a></li>	
							<li><a href="../page/sys_dept.html">部门管理</a></li>	
							<li><a href="../page/sys_emp.html">员工管理</a></li>	
							<li><a href="../page/sys_menupower.html">菜单权限设置</a></li>	
							<li><a href="../page/sys_areapower.html">辖区权限设置</a></li>	
							<li><a href="../page/sys_waterType.html">用水类型设定</a></li>	
							<li><a href="../page/sys_surcharge.html">附加费设定</a></li>	
							<li><a href="../page/sys_flow.html">流程配置</a></li>	
						</ul>
						
					</div>
				</li>
				
				<li class="nav_current nav_dropdown nav_icon_only">
					<a href="javascript:;">&nbsp;</a>
					
					<div class="nav_menu">
						<ul>
							<li><a href="../workspace.html">我的工作台</a></li>
							<li><a href="../page/sys_pwd.html">修改密码</a></li>
							<li><a href="../login.html">退出系统</a></li>
						</ul>
					</div> <!-- .menu -->
				</li>
			</ul>
		</div> <!-- .content_pad -->
		
	</div> <!-- #header -->	
	
	<div id="masthead">
		<div>
			<span id="pagetitle"><a href="javascript:;">销账明细报表</a></span>
			<span id="welcome_span">欢迎回来，马云</span>
		</div>
	</div> <!-- #masthead -->	
	
	<form action="inv_invoiceReportMoneyDetail.html" method="post">
	<div id="content" class="xgrid" >
		<div class="x12"  style=" margin-bottom:0px;">
			<h2>销账明细报表</h2>
			<div class="searchDiv">
				<div>		 
					发票类型 <select id="InvoiceType" name="InvoiceType">
								<option value="-1">所有</option>
					            <option value="2">普通发票</option>
								<option value="1">增值税发票</option>
							 </select>
					
					<button type="submit" class="btn btn-small btn-icon btn-find"><span></span>查询</button>
					<button type="button" onclick="method1('ta')"  class="btn btn-small btn-icon btn-star btn-blue"><span></span>
						导出到Excel文件</button>
				</div>
				<div> 
					<div style="float:left;width:298px;">
					发票号码 <span class="between">
							<input id="t_invoice1" name="haoma1" value="0" /> 
							<input type="checkbox" id="ck_invoice_between" class="checkbox"
							onclick="$('#t_invoice2').toggle();" />
							<label for="ck_invoice_between">至</label>
							<input id="t_invoice2" class="hide" name="haoma2" value="0" />
						</span>
					</div>
						
					<div style="float:left;width:298px;">
					收费日期 <span class="between">
							<input id="t_paydate1" onClick="WdatePicker();" name="date1"/> 
							<input type="checkbox" id="ck_paydate_between" class="checkbox"
							onclick="$('#t_paydate2').toggle();" />
							<label for="ck_paydate_between">至</label>
							<input id="t_paydate2" onClick="WdatePicker();" class="hide" name="date2" />
						</span>
					</div>
						 
					<div style="float:left;width:298px;">
					销账日期 <span class="between">
							<input id="t_xzdate1" onClick="WdatePicker();" name="date3"/> 
							<input type="checkbox" id="ck_xzdate_between" class="checkbox"
							onclick="$('#t_xzdate2').toggle();" />
							<label for="ck_xzdate_between">至</label>
							<input id="t_xzdate2" onClick="WdatePicker();" class="hide" name="date4" />
						</span>
					</div>
				</div>
			</div>
		</div> <!-- .x12 -->
	</div> <!-- #content -->
	</form>
	<div class="reportTitle">
		销账明细报表
	</div>	
	
	<div class="reportDiv" style="width:2080px;">
		<table class="report" id="ta" style="width:90%;" align="center">
			<thead>
				<th width="160">交费单号</th>
				<th width="80">发票号</th>
				<th width="80">发票类型</th>
				<th width="80">交费日期</th>
				<th width="80">交费金额</th>
				<th width="80">已用金额</th>
				<th width="80">剩余金额</th>
				<th width="80">收费员</th>
				<th width="80">生活用水量</th>
				<th width="80">商业用水量</th>
				<th width="80">工业用水量</th>
				<th width="80">行政用水量</th>
				<th width="80">军区用水量</th>
				<th width="80">特种用水量</th>
				<th width="80">销账总水量</th>
				<th width="80">生活用水销账</th>
				<th width="80">商业用水销账</th>
				<th width="80">工业用水销账</th>
				<th width="80">行政用水销账</th>
				<th width="80">军区用水销账</th>
				<th width="80">特种用水销账</th>
				<th width="80">垃圾费销账</th>
				<th width="80">污水费销账</th>
				<th width="80">资源费销账</th>
				<th width="80">销账总金额</th>
			</thead>
			<tbody>
				<tr th:each="m,i:${zmingxi}">
					<td align="center" th:text="*{m.PayNo}"></td>
					<td align="center" th:text="*{m.InvoiceNo}"></td>
					<td align="center" th:text="*{m.InvoiceType}==0?'普通发票':'增值税发票'"></td>
					<td align="center" th:text="*{#dates.format(m.ArchiveDate, 'yyyy年MM月dd日')}"></td>
					<td align="right" th:text="*{m.PayMoney}"></td>
					<td align="right" th:text="*{m.UseMoney}"></td>
					<td align="right" th:text="*{m.PayMoney-m.UseMoney}"></td>
					<td align="center" class="split" th:text="*{m.EmpNmae}"></td>
					<td align="right" th:text="*{m.Amount}"></td>
					<td align="right">120</td>
					<td align="right">130</td>
					<td align="right">140</td>
					<td align="right">150</td>
					<td align="right">160</td>
					<td align="right" class="split" th:text="*{m.Amount+120+130+140+150+160}"></td>
					<td align="right" th:text="*{m.BalanceMoney}"></td>
					<td align="right">1000</td>
					<td align="right">1100</td>
					<td align="right">1600</td>
					<td align="right">2000</td>
					<td align="right">3000</td>
					<td align="right">100</td>
					<td align="right">200</td>
					<td align="right">300</td>
					<td align="right" class="split" th:text="*{m.BalanceMoney+1000+1100+1600+2000+3000+100+200+300}"></td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td align="center">&nbsp;</td>
					<td align="center">&nbsp;</td>
					<td align="center">&nbsp;</td>
					<td align="center">&nbsp;</td>
					<td align="right"><div title="1234567891234567.89">20500.00</div></td>
					<td align="right"><div title="1234567891234567.89">600.00</div></td>
					<td align="right"><div title="1234567891234567.89">20900.00</div></td>
					<td align="center" class="split">&nbsp;</td>
					<td align="right"><div title="1234567891234567">630.00</div></td>
					<td align="right"><div title="1234567891234567">600.00</div></td>
					<td align="right"><div title="1234567891234567">910.00</div></td>
					<td align="right"><div title="1234567891234567">980.00</div></td>
					<td align="right"><div title="1234567891234567">1200.00</div></td>
					<td align="right"><div title="1234567891234567">1280.00</div></td>
					<td align="right" class="split"><div title="1234567891234567">4130.00</div></td>
					<td align="right"><div title="1234567891234567.89">22500.00</div></td>
					<td align="right"><div title="1234567891234567.89">6000.00</div></td>
					<td align="right"><div title="1234567891234567.89">7700.00</div></td>
					<td align="right"><div title="1234567891234567.89">11200.00</div></td>
					<td align="right"><div title="1234567891234567.89">21000.00</div></td>
					<td align="right"><div title="1234567891234567.89">895.00</div></td>
					<td align="right"><div title="1234567891234567.89">700.00</div></td>
					<td align="right"><div title="1234567891234567.89">1400.00</div></td>
					<td align="right"><div title="1234567891234567.89">2100.0</div></td>
					<td align="right" class="split"><div title="1234567891234567.89">69000.00</div></td>
				</tr>
			</tfoot>
		</table>
	</div>
	<div class="xgrid">
		   <form action="" method="post" name="f1">
                <div class="page">
                    <a href="javascript:f1.startPage.value=1;f1.submit()">首页</a>
                    <a th:if="${pageInfo.hasPreviousPage}" href="javascript:f1.startPage.value=f1.startPage.value-1;f1.submit()" aria-label="Previous">上一页</a>
                    <input name="startPage" th:value="${startPage }"  style="width: 20px"/> / [[${pageInfo.pages}]]页.一共 [[${pageInfo.total}]] 条记录
                    <a th:if="${pageInfo.hasNextPage}" href="javascript:f1.startPage.value=f1.startPage.value-0+1;f1.submit()"
                       aria-label="Next">下一页</a>
                    <a th:href="|javascript:f1.startPage.value=${pageInfo.pages};f1.submit()|">尾页</a>
                </div>
            </form>
	</div>
	
	<div id="footer">		
		<div class="content_pad">			
			<p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>.   技术支持 <a href="#">职业教育</a>.</p>
		</div> <!-- .content_pad -->
	</div> <!-- #footer -->
	
</div> <!-- #wrapper -->
<script src="../js/jquery/jquery-3.2.1.min.js"></script>
<script src="../js/jquery/jquery.table2excel.js"></script>
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>
<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>
<script src="../My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
	
$(document).ready ( function () 
{
	Dashboard.init ();
	
});


</script>

</body> 
 
</html>